package com.example.airobotinterviewrecord.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.example.airobotinterviewrecord.entity.enums.InterviewStatus;
import com.example.airobotinterviewrecord.entity.enums.InterviewTypeEnum;
import com.example.airobotinterviewrecord.entity.enums.SendEmailEnum;
import com.example.airobotinterviewrecord.handler.InterviewStatusTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "interview_schedule", autoResultMap = true)
@ApiModel(value="InterviewSchedule对象", description="面试安排表")
public class InterviewSchedule implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键ID", example = "1")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "候选人ID", example = "1001")
    @TableField("candidate_id")
    private Integer candidateId;

    @ApiModelProperty(value = "职位ID", example = "2001")
    @TableField("position_id")
    private Integer positionId;

    @ApiModelProperty(value = "面试类型: 1-数字人面试  2-人工面试  3-混合面试", example = "1")
    @TableField("interview_type")
    private InterviewTypeEnum interviewType;

    @ApiModelProperty(value = "面试时间", example = "2025-05-01T14:30:00")
    @TableField("interview_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime interviewTime;

    @ApiModelProperty(value = "面试时长(分钟)", example = "60")
    @TableField("duration")
    private Integer duration;

    @ApiModelProperty(value = "数字人面试官ID", example = "3001")
    @TableField("digital_interviewer_id")
    private Integer digitalInterviewerId;

    @ApiModelProperty(value = "备注", example = "候选人需准备身份证复印件")
    @TableField("notes")
    private String notes;

    @ApiModelProperty(value = "是否发送短信: 0-否, 1-是", example = "1")
    @TableField("send_email")
    private SendEmailEnum sendEmail;

    @ApiModelProperty(value = "面试状态: 1-待面试, 2-已完成, 3-已取消, 4-已延期", example = "1")
    @TableField(typeHandler = InterviewStatusTypeHandler.class)
    private InterviewStatus status;

    @ApiModelProperty(value = "创建人ID", example = "5001")
    @TableField("created_by")
    private Integer createdBy;

    @ApiModelProperty(value = "创建时间", example = "2025-04-10T10:00:00")
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;

    @ApiModelProperty(value = "更新时间", example = "2025-04-10T10:00:00")
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;

    @ApiModelProperty(value = "题目集ID", example = "[1, 2, 3]")
    @TableField(value = "question_set_ids", typeHandler = JacksonTypeHandler.class)
    private List<Integer> questionSetIds;
}